package com.sun.mybatisplus.common;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
public class Condition {

    public Condition() {
    }

    public static <T> IPage<T> getPage(Query query) {
        Page<T> page = new Page(query.getCurrent()==0?1:query.getCurrent(),query.getSize() == 0?10:query.getSize());
        return page;
    }

    public static <T> QueryWrapper<T> getQueryWrapper(T entity) {
        return new QueryWrapper(entity);
    }
}
